package com.sky.mapper;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 套餐管理mapper层
 * @className SetmealMapper
 * @description SetmealMapper
 * @auth xxk
 * @date 2025/7/3
 */
@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {

    /**
     * 根据分类id查询套餐数量
     * @param categoryId
     * @return Integer
     * @description description
     */
    Integer countByCategoryId(@Param("categoryId") Long categoryId);

    /**
     * 更新套餐
     * @param setmeal
     * @description description
     */
    @AutoFill(value = OperationType.UPDATE)
    void update(Setmeal setmeal);

    /**
     * 新增套餐
     * @param setmeal
     * @return int
     * @description description
     */
    @AutoFill(value = OperationType.INSERT)
    int insertSelective(Setmeal setmeal);

    /**
     * 批量新增套餐
     * @param list
     * @return int
     * @description description
     */
    int insertList(@Param("list")List<Setmeal> list);

    /**
     * 套餐分页查询
     * @param setmealPageQueryDTO
     * @return Page<SetmealVO>
     * @description description
     */
    Page<SetmealVO> pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);

    Setmeal selectById(@Param("id")Long id);

    Setmeal getById(@Param("id")Long id);

    /**
     * 查询list
     * @param setmeal
     * @return List<Setmeal>
     * @description description
     */
    List<Setmeal> list(Setmeal setmeal);
}
